/*
 * @Author: wangmyng wangmyng@163.com
 * @Date: 2025-11-02 22:00:53
 * @LastEditors: wangmyng wangmyng@163.com
 * @LastEditTime: 2025-11-09 23:13:56
 */
import { useState, useRef } from "react";
import "./index.less";
import { fetchCurrentWarningList } from "@/api/hap";
import DashboardCard from "@/components/pc/DashboardCard";

interface CarListCardProps {
  collapsed?: boolean;
}

interface WarningItem {
  incidentCategory: any;
  id: string;
  serial: number;
  incidentStatus: string;
  incidentAddress: string;
  receiveTime: string;
}

/**
 * 首页：车辆列表
 */
const CarListCard: React.FC<CarListCardProps> = () => {
  const [warningList, setWarningList] = useState<WarningItem[]>([]);

  useEffect(() => {
    loadWarningList();
  }, []);

  const loadWarningList = useCallback(async () => {
    const data = await fetchCurrentWarningList();
    setWarningList(data);
  }, []);

  return (
    <div className={`car-list-card`}>
      <DashboardCard titles={["车辆列表"]}>
        <div className="content-container">
          <div className="alerts-column">
            <div className="column-title">未排消息</div>
          </div>
        </div>
      </DashboardCard>
    </div>
  );
};

export default CarListCard;
